<?php

class SpreadScannerController extends Am_Controller
{
    /** product id# that allow access to this page */
    protected $productIds = array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17);
    
    function indexAction()
    {
        $this->getDi()->auth->requireLogin();
        
        if (!array_intersect($this->productIds, $this->getDi()->user->getActiveProductIds()))
        {
            throw new Am_Exception_InputError("You have no access to this page");
        }

        $url = Am_Di::getInstance()->plugins_misc->loadGet('atip')->getAccessURL();
        
        /*$code = Am_Di::getInstance()->plugins_misc->loadGet('darrell-api')->getAccessCode();*/

$content = <<<CUT
<p>
  <iframe src="$url" style="width:100%; height:25000px; overflow:hidden; "></iframe></p>
CUT;

       $this->view->title = "Spread Scanner and other tools"; // set head-title of page
       $this->view->content = $content; // set content of page
       $this->view->layoutNoTitle = $this->view->layoutNoLang = $this->view->layoutNoMenu = true; // disable menu display
       $this->view->display('layout.phtml'); // display $content inside aMember/WP layout
   }  
}
